/**
 * 
 */
package com.ld.tamp.web.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;

import com.ld.tamp.web.dao.ComponentAccessTokenDao;
import com.ld.tamp.web.dao.ComponentVerifyTicketDao;
import com.ld.tamp.web.event.AuthorizationEvent;
import com.ld.tamp.web.event.UnAuthorizationEvent;
import com.ld.tamp.web.support.AuthorizerAccessTokenManager;

/**
 * @author KeYang
 *
 */
public class UnAuthorizationEventListener implements ApplicationListener<UnAuthorizationEvent>{

	private static final Logger logger = LoggerFactory.getLogger(UnAuthorizationEvent.class);
	
	/* (non-Javadoc)
	 * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
	 */
	@Override
	public void onApplicationEvent(UnAuthorizationEvent event) {
		logger.info("删除公众号的定时刷新token任务，appid：{}",event.getAuthorizerAppid());
		AuthorizerAccessTokenManager.destroyed(event.getAuthorizerAppid());
	}
}

